<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="docgen-resources/docgen.css" type="text/css">
  <meta name="generator" content="FreeMarker Docgen (DocBook 5)">
  <title>
    FreeMarker Manual - include
  </title>
    <script type="text/javascript" src="docgen-resources/jquery.js"></script>
    <script type="text/javascript" src="docgen-resources/linktargetmarker.js"></script>
</head>
<body>

    <div class="navigation">
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="ref.html">Reference</a>
            <b>></b>
          <a href="ref_directives.html">Directive Reference</a>
            <b>></b>
          include
</span>    </div>
    <div class="bookmarks">
<span class="bookmarks">Bookmarks:
<a href="alphaidx.html">Alphabetical Index</a>, <a href="gloss.html">Glossary</a>, <a href="ref.html">Reference</a>, <a href="app_faq.html">FAQ</a>, <a href="api/index.html">Java API</a>, <a href="../index.html">FreeMarker Home</a></span>    </div>
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="ref_directive_import.html"><span class="hideA">Next page: </span>import</a></div><div class="pagerButton"><a href="ref_directive_list.html">Previous page</a></div><div class="pagerButton"><a href="ref_directives.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    </div>

<div id="mainContent">

  
  
  
  
  <h1 class="rank_section1"
        id="pageTopTitle">
<a name="ref_directive_include"></a>include  </h1>
    
    <div class="toc">
      <p>
        <b>
            Page Contents
        </b>
      </p>
      
  <ul class="noMargin">
      <li>
        <a href="#autoid_84">Synopsis</a>
      </li>
      <li>
        <a href="#autoid_85">Description</a>
  <ul >
      <li>
        <a href="#ref_directive_include_acquisition">Using acquisition</a>
      </li>
      <li>
        <a href="#ref_directive_include_localized">Localized lookup</a>
      </li>
  </ul>
      </li>
  </ul>
    </div>
    <a name="docgen_afterTheTOC"></a>
    
<a name="ref.directive.include"></a>
            
  
  
  
  <h2 class="rank_section2"
        >
<a name="autoid_84"></a>Synopsis  </h2>


          <pre class="metaTemplate">
<tt style="color: #A03D10">&lt;#include <i style="color: #DD4400">path</i>&gt;</tt>
or
<tt style="color: #A03D10">&lt;#include <i style="color: #DD4400">path</i> <i style="color: #DD4400">options</i>&gt;</tt>
</pre>


          <p>Where:</p>

              <div class="itemizedlist">
<ul>
            <li>
              <tt style="color: #A03D10"><i style="color: #DD4400">path</i></tt>: The
              path of the file to include; an expression that evaluates to a
              string. (With other words, it doesn't have to be a fixed string,
              it can also be something like, for example,
              <tt style="color: #A03D10">profile.baseDir + &quot;/menu.ftl&quot;</tt>.)
            </li>

            <li>
              <tt style="color: #A03D10"><i style="color: #DD4400">options</i></tt>: One
              or more of these:
              <tt style="color: #A03D10">encoding=<i style="color: #DD4400">encoding</i></tt>,
              <tt style="color: #A03D10">parse=<i style="color: #DD4400">parse</i></tt>

                  <div class="itemizedlist">
<ul>
                <li>
                  <tt style="color: #A03D10"><i style="color: #DD4400">encoding</i></tt>:
                  Expression evaluates to string
                </li>

                <li>
                  <tt style="color: #A03D10"><i style="color: #DD4400">parse</i></tt>:
                  Expression evaluates to boolean (also accepts a few string
                  values for backward compatibility)
                </li>
              </ul>    </div>

            </li>
          </ul>    </div>

        
            
  
  
  
  <h2 class="rank_section2"
        >
<a name="autoid_85"></a>Description  </h2>


          <p>You can use it to insert another FreeMarker template file
          (specified by the <tt style="color: #A03D10"><i style="color: #DD4400">path</i></tt>
          parameter) into your template. The output from the included template
          is inserted at the point where the <tt style="color: #A03D10">include</tt> tag
          occurs. The included file shares the variables with the including
          template, similarly like if it was copy-pased into it. The
          <tt style="color: #A03D10">include</tt> directive is not replaced by the content
          of the included file, it just processes the included file each time
          when FreeMarker reaches the <tt style="color: #A03D10">include</tt> directive in
          the course of template processing. So for example if the
          <tt style="color: #A03D10">include</tt> is inside a <tt style="color: #A03D10">list</tt>loop,
          you can specify different file names in each cycle.</p>

          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <p class="rank_note">Note</p>

            <p>This directive is not be confused with the JSP (Servlet)
            include, as it doesn't involve the Servlet container at all, just
            processes another FreeMarker template, without &quot;leaving&quot;
            FreeMarker. Regarding how to do a &quot;JSP include&quot; <a href="app_faq.html#faq_servlet_include">read this...</a></p>
          </div>


          <p>The <tt style="color: #A03D10"><i style="color: #DD4400">path</i></tt>
          parameter can be a relative path like <tt style="color: #A03D10">&quot;foo.ftl&quot;</tt>
          and <tt style="color: #A03D10">&quot;../foo.ftl&quot;</tt>, or an absolute like
          <tt style="color: #A03D10">&quot;/foo.ftl&quot;</tt>. Relative paths are relative to the
          directory of the template that uses the <tt style="color: #A03D10">import</tt>
          directive. Absolute paths are relative to a base (often referred as
          the ''root directory of the templates'') that the programmer defines
          when he configures FreeMarker.</p>

          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <p class="rank_note">Note</p>

            <p>This is different than the way it worked prior FreeMarker
            2.1, where the path was always absolute. To preserve the old
            behavior, enable the classic compatible mode in the
            <tt style="color: #A03D10">Configuration</tt> object.</p>
          </div>


          <p>Always use <tt style="color: #A03D10">/</tt> (slash) to separate path
          components, never <tt style="color: #A03D10">\</tt> (backslash). If you are
          loading templates from your local file system and it uses
          backslashes (like under. Windows), FreeMarker will convert them
          automatically.</p>

          <p>Example:</p>

          <p>Assume /common/copyright.ftl contains:</p>

          <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
Copyright 2001-2002 ${me}&lt;br&gt;
All rights reserved.&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>Then this:</p>

          <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;#assign me = &quot;Juila Smith&quot;&gt;
&lt;h1&gt;Some test&lt;/h1&gt;
&lt;p&gt;Yeah.
&lt;hr&gt;
<b>&lt;#include &quot;/common/copyright.ftl&quot;&gt;</b>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>will output this:</p>

          <div align="left" class="programlisting"><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#CCFFCC" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;h1&gt;Some test&lt;/h1&gt;
&lt;p&gt;Yeah.
&lt;hr&gt;
<b>Copyright 2001-2002 Juila Smith
All rights reserved.</b>&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p>The supported
          <tt style="color: #A03D10"><i style="color: #DD4400">options</i></tt> are:</p>

              <div class="itemizedlist">
<ul>
            <li>
              <p>parse: If it is true, then the included file will be
              parsed as FTL, otherwise the whole file will be considered as
              simple text (i.e, no FreeMarker constructs will be searched in
              it). If you omit this option, then it defaults to true.</p>
            </li>

            <li>
              <p>encoding: The included file inherits the encoding (in
              practice: the charset) of the including template, unless you
              specify an encoding with this option. <span style="color:#333399; font-style:italic">Encoding names are the same as the ones
              supported be java.io.InputStreamReader (as of Java API 1.3:
              MIME-preferred charset names from the IANA Charset
              Registry).</span> Examples of valid names: ISO-8859-2, UTF-8,
              Shift_JIS, Big5, EUC-KR, GB2312.</p>
            </li>
          </ul>    </div>


          <p>Example:</p>

          <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;#include &quot;/common/navbar.html&quot; parse=false encoding=&quot;Shift_JIS&quot;&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


          <p><span style="color:#333399; font-style:italic">Note, that it is possible to
          automatically do the commonly used inclusions for all templates,
          with the &quot;auto includes&quot; setting of
          <tt style="color: #A03D10">Configuration</tt>.</span></p>

          
              
  
  
  
  <h3 class="rank_section3"
        >
<a name="ref_directive_include_acquisition"></a>Using acquisition  </h3>


            

            <p>There's a special path component represented by an asterisk
            (<tt style="color: #A03D10">*</tt>). It is interpreted as &quot;this directory or
            any of its parents&quot;. Therefore, if the template located in
            <tt style="color: #A03D10">/foo/bar/template.ftl</tt> has the following
            line:</p>

            <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;#include &quot;*/footer.ftl&quot;&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


            <p>then the engine will look for the template in following
            locations, in this order:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <tt style="color: #A03D10">/foo/bar/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/footer.ftl</tt>
              </li>
            </ul>    </div>


            <p>This mechanism is called <b>acquisition</b> and allows the designers to
            place commonly included files in a parent directory, and redefine
            them on a per-subdirectory basis as needed. We say that the
            including template acquires the template to include from the first
            parent directory that has it. Note that you can specify not only a
            template name to the right of the asterisk, but a subpath as well.
            I.e. if the previous template instead read:</p>

            <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;#include &quot;*/commons/footer.ftl&quot;&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


            <p>then the engine would look for the template in following
            locations, in this order:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <tt style="color: #A03D10">/foo/bar/commons/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/commons/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/commons/footer.ftl</tt>
              </li>
            </ul>    </div>


            <p>Finally, the asterisk needn't be the first element of the
            path:</p>

            <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;#include &quot;commons/*/footer.ftl&quot;&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


            <p>would cause the engine to look for the template in following
            locations, in this order:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <tt style="color: #A03D10">/foo/bar/commons/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/bar/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/footer.ftl</tt>
              </li>
            </ul>    </div>


            <p>However, there can be at most one asterisk in the path.
            Specifying more than one asterisk will result in a template not
            being found.</p>
          

          
              
  
  
  
  <h3 class="rank_section3"
        >
<a name="ref_directive_include_localized"></a>Localized lookup  </h3>


            

            <p>Whenever a template is loaded, it is assigned a locale. A
            locale is a language and an optional country or dialect
            identifier. A template is typically loaded by some code that the
            programmer wrote and he chooses a locale for the template based on
            some aspect. For example, when the
            <tt style="color: #A03D10">FreemarkerServlet</tt> loads templates, it always
            requests the template with locale matching the language preference
            of the browser that requested the web page.</p>

            <p>Whenever a template is loaded, it is assigned a locale. A
            locale is a language and an optional country or dialect
            identifier. A template is typically loaded by some code that the
            programmer wrote and he chooses a locale for the template based on
            some aspect. For example, when the
            <tt style="color: #A03D10">FreeMarkerServlet</tt> loads templates, it always
            requests the template with locale matching the language preference
            of the browser that requested the web page.</p>

            <p>When a template includes another template, it attempts to
            load a template with the same locale. Suppose your template was
            loaded with locale <tt style="color: #A03D10">en_US</tt>, which means U.S.
            English. When you include another template:</p>

            <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;include &quot;footer.ftl&quot;&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


            <p>the engine will in fact look for several templates, in this
            order:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <tt style="color: #A03D10">footer_en_US.ftl</tt>,
              </li>

              <li>
                <tt style="color: #A03D10">footer_en.ftl</tt>, and finally
              </li>

              <li>
                <tt style="color: #A03D10">footer.ftl</tt>
              </li>
            </ul>    </div>


            <p><span style="color:#333399; font-style:italic">Note that you can disable
            localized lookup feature with the
            <tt style="color: #A03D10">setLocalizedLookup</tt> method of
            <tt style="color: #A03D10">Configuration</tt>.</span></p>

            <p>When you use both acquisition and localized template lookup,
            the template with more specific locale in a parent directory takes
            precedence over template with less specific locale in a child
            directory. Suppose you use the following include from
            <tt style="color: #A03D10">/foo/bar/template.ftl</tt>:</p>

            <div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;#include &quot;*/footer.ftl&quot;&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>


            <p>the engine will look for these templates, in this
            order:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <tt style="color: #A03D10">/foo/bar/footer_en_US.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/footer_en_US.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/footer_en_US.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/bar/footer_en.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/footer_en.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/footer_en.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/bar/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/foo/footer.ftl</tt>
              </li>

              <li>
                <tt style="color: #A03D10">/footer.ftl</tt>
              </li>
            </ul>    </div>

          
          
</div>

    <div class="navigation">
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="ref_directive_import.html"><span class="hideA">Next page: </span>import</a></div><div class="pagerButton"><a href="ref_directive_list.html">Previous page</a></div><div class="pagerButton"><a href="ref_directives.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="ref.html">Reference</a>
            <b>></b>
          <a href="ref_directives.html">Directive Reference</a>
            <b>></b>
          include
</span>    </div>
    </div>

<table border=0 cellspacing=0 cellpadding=0 width="100%">
    <tr>
      <td colspan=2><img src="docgen-resources/img/none.gif" width=1 height=8 alt=""></td>
    <tr>
      <td align="left" valign="top"><span class="smallFooter">
            FreeMarker Manual -- For FreeMarker 2.3.16
            <br>
          HTML generated: 2009-12-08 08:38:54 GMT
      </span></td>
      <td align="right" valign="top"><span class="smallFooter">
          <a href="http://www.xmlmind.com/xmleditor/">
            <img src="docgen-resources/img/xxe.gif" alt="Edited with XMLMind XML Editor">
          </a>
      </span></td>
    </tr>
</table>
  <!-- Put pre-loaded images here: -->
  <div style="display: none">
    <img src="docgen-resources/img/linktargetmarker.gif" alt="Here!" />
  </div>
</body>
</html>

